import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { UploadTypeEnum } from '/@/components/Form/src/jeecg/components/JUpload';
//列表数据
export const columns : BasicColumn[] = [

	{
		title: '所在城市',
		align: "center",
		dataIndex: 'cityid_dictText'
	},
	{
		title: '景点名称',
		align: "center",
		dataIndex: 'title'
	},
	
	{
		title: '游玩小时',
		align: "center",
		dataIndex: 'playTime'
	},
	{
		title: '详细地址',
		align: "center",
		dataIndex: 'address'
	},
	{
		title: '费用说明',
		align: "center",
		dataIndex: 'feeDescription'
	},
	{
		title: '行程亮点',
		align: "center",
		dataIndex: 'lightspot'
	},
];
export const searchFormSchema : FormSchema[] = [
	{
		label: "所在城市",
		field: 'cityid',
		component: 'JTreeDict',
		componentProps: { async: true, parentCode: 'A02' },
		//colProps: {span: 6},
	},
	{
		label: "商家名称",
		field: 'title',
		component: 'Input',
	},
];
//表单数据
export const formSchema : FormSchema[] = [

	{
		label: '景点名称',
		field: 'title',
		component: 'Input',
	},
	{
		label: '游玩小时',
		field: 'playTime',
		component: 'Input',
	},
	{
		label: '所在城市',
		field: 'cityid',
		component: 'JTreeDict',
		componentProps: { async: true, parentCode: 'A02' },
	},
	{
		label: '行程亮点',
		field: 'lightspot',
		component: 'InputTextArea',
	},
	{
		label: '费用说明',
		field: 'feeDescription',
		component: 'InputTextArea',
	},
	{
		label: '经纬度',
		field: 'gis',
		component: 'Input',
		slot: 'lotAndLat'
	},
	{
		label: '详细地址',
		field: 'address',
		component: 'InputTextArea',
	},
	{
		label: '景点图片',
		field: 'imgs',
		component: 'JUpload',
		helpMessage: '最多上传10张图片',
		componentProps: {
			fileType: UploadTypeEnum.image,
			maxCount: 10,
		}
	},
	{
		label: '景点介绍',
		field: 'msg',
		component: 'JEditor',
	},


	// TODO 主键隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData) : FormSchema[] {
	// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
	return formSchema;
}